import pandas as pd

ser = pd.Series([10, 8, 9], index=['a', 'b', 'c'])
ser2 = pd.Series([3, 6, 7], index=['b', 'c', 'd'])

ser3 = ser + ser2

# 判断是否有缺失值
print(ser3.isnull())

# 删掉缺失值
print(ser3[ser3.notnull()])

# 删掉缺失值
print(ser3.dropna())

# 覆盖缺失值
print(ser3.fillna(0))

# 覆盖缺失值(平均值)
print(ser3.fillna(ser3.mean()))

print('-------------------------------------------------------')

ser4 = ser.add(ser2, fill_value=0)
print(ser4)

ser5 = pd.Series(ser.add(ser2, fill_value=0), dtype=int)
print(ser5)
